import requests

headers = {
    "Authorization": "SE-python",
    # "Content-Type": 'application/json; charset=utf-8'
}

user = {
    "account": "python@cc.cc",
    "password": "python123"
}
company_info = {
    "company_name": "石家庄盈奕进出口贸易有限公司",
    "company_url": "www.machineyingyee.com"
}

data = {
    "account": user['account'],
    "password": user['password'],
    "company_name": company_info['company_name'],
    "company_url": company_info['company_url'],
    "keys_list": "1111,222,33"
}
params = {
    "account": user['account'],
    "password": user['password'],
    "company_name": company_info['company_name'],
}

#创建项目
# res = requests.post("http://127.0.0.1:8890/SE/creat_project", headers=headers, data=data)
# print(res.json())
# print(res)
#重新登录
# res = requests.post("http://127.0.0.1:8890/SE/retry_login", headers=headers, data=data)
# print(res.json())
# print(res)
#添加关键词
# res = requests.post("http://103.229.127.202:8890/SE/add_keys", headers=headers, data=data, timeout=360)
# print(res.json())
# print(res)
#进度条查询
# res = requests.get("http://127.0.0.1:8890/SE/index_bar", headers=headers, params=params, timeout=360)
# print(res.json())
# print(res)
#复查关键词
# res = requests.get("http://127.0.0.1:8890/SE/recheck_keys", headers=headers, data=data, timeout=360)
# print(res.json())
# print(res)
#导出表格
# res = requests.get("http://127.0.0.1:8890/SE/export_excel", headers=headers, data=data, timeout=360)
# print(res.json())
# print(res)
#查看项目
# res = requests.get("http://127.0.0.1:8890/SE/project", headers=headers, params=params, timeout=360)
# print(res.json())
# print(res)
#判断cookies信息是否有效
# res = requests.get("http://127.0.0.1:8890/SE/cookies", headers=headers, params=params, timeout=360)
# print(res.json())
# print(res)
#限制词查询
res = requests.get("http://127.0.0.1:8890/SE/limits", headers=headers, params=params, timeout=360)
print(res.json())
print(res)
#获取表格
# res = requests.get("http://127.0.0.1:8890/SE/get_excel", headers=headers, data=data, timeout=360)
# print(res.content)
# with open(f'{company_info["company_name"]}.xlsx', 'wb')as f:
#     f.write(res.content)